構築、破棄、コピー

空のコンテナー・コンストラクター


concurrent_queue(); 

explicit concurrent_queue( const allocator_type& alloc );

explicit explicit concurrent_priority_queue( const Compare& compare, const allocator_type& alloc );

空の concurrent_queue を構築。利用可能であれば、アロケーター alloc を使用してメモリーを割り当てます。

要素のシーケンスから構築


template <
typename InputIterator> 
concurrent_queue( InputIterator first, InputIterator last, 
                  const allocator_type& alloc = allocator_type() );

アロケーター alloc を使用して、半開区間 [first, last) のすべての要素を含む concurrent_queue を構築します。

要件: InputIterator タイプは、ISO C++ 標準の [input.iterators] セクションの InputIterator 要件を満たしている必要があります。


concurrent_queue( std::initializer_list<value_type> init, 
                  const allocator_type& alloc = allocator_type() );

concurrent_queue(init.begin(), init.end(), alloc) と等価です。

コンストラクターをコピー


concurrent_queue( const concurrent_queue& other ); 

concurrent_queue( const concurrent_queue& other, 
                  const allocator_type& alloc );

other のコピーを作成します。

アロケーター引数が指定されていない場合、std::allocator_traits<allocator_type>::select_on_container_copy_construction(other.get_allocator()) で取得できます。

other との同時操作が行われると動作は未定義です。

ムーブ・コンストラクター


concurrent_queue( concurrent_queue&& other ); 

concurrent_queue( concurrent_queue&& other, 
                  const allocator_type& alloc );

ムーブ・セマンティクスを使用して、other の内容で concurrent_queue を作成します。

other は有効のままですが、未指定の状態となります。

アロケーター引数が指定されていない場合、std::move(other.get_allocator()) で取得できます。

other との同時操作が行われると動作は未定義です。

デストラクター

~concurrent_queue();

concurrent_queue を破棄します。ストアされた要素のデストラクターを呼び出してストレージの割り当てを解除します。

*this との同時操作が行われると動作は未定義です。

代入操作

concurrent_queue& operator=( const concurrent_queue& other );

*this のすべての要素を other の要素をコピーして置き換えます。

std::allocator_traits<allocator_type>::propagate_on_container_copy_assignment::valuetrue の場合、アロケーターのコピーを割り当てます。

*thisother の同時操作が行われると動作は未定義です。

戻り値: *this への参照を返します。

concurrent_queue& operator=( concurrent_queue&& other );

*this のすべての要素を、ムーブ・セマンティクスによって other の要素で置き換えます。

other は有効のままですが、未指定の状態となります。

std::allocator_traits<allocator_type>::propagate_on_container_move_assignment::valuetrue の場合、アロケーターの要素を移動して割り当てます。

*thisotherの同時操作が行われると動作は未定義です。

戻り値: *this への参照を返します。

concurrent_queue& operator=( std::initializer_list<value_type> init );

*this のすべての要素を init の要素して置き換えます。

*this との同時操作が行われると動作は未定義です。

戻り値: *this への参照を返します。

代入


template <typename InputIterator> 
void assign( InputIterator first, InputIterator last );

*this のすべての要素を半開区間 [first, last) の要素で置き換えます。

*this との同時操作が行われると動作は未定義です。

要件: InputIterator タイプは、ISO C++ 標準の [input.iterators] セクションの InputIterator 要件を満たしている必要があります。

void assign( std::initializer_list<value_type> init );

assign(init.begin(), init.end()) と等価です。